#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
       int x=1;
       pid_t p=fork();
       if(p<0)
       {
            perror("fork fail");
            exit(1);
       }
        else if(p==0)
        {
          printf("Chird has x= %d\n",++x);
        }
        else
        {
          printf("Parent has x =%d\n",--x);
        }     
        return 0;
}

